<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件切换</title>
</head>
<body>
    <div id="div">我是div</div>
</body>
<script src="js/jquery-3.3.1.min.js"></script>
<script>
    $("#div").hover(function(){
        $(this).css("background","red");
    },function(){
       $(this).css("background","blue");
    });
</script>
</html>